- breadcrumb_title _("General settings")
- page_title _("General settings")
- expanded = expanded_by_default?
- @force_desktop_expanded_sidebar = true

= render 'shared/namespaces/cascading_settings/lock_tooltips'

%h1.gl-sr-only= @breadcrumb_title

- if can?(current_user, :admin_group, @group)
  = render ::Layouts::SettingsBlockComponent.new(_('Naming, description, visibility'),
    id: 'js-general-settings',
    testid: 'general-settings',
    expanded: true) do |c|
    - c.with_description do
      = _('Update your group name, description, avatar, and visibility.')
      = link_to _('Learn more about groups.'), help_page_path('user/group/_index.md')
    - c.with_body do
      = render 'groups/settings/general'

  = render ::Layouts::SettingsBlockComponent.new(_('Permissions and group features'),
    id: 'js-permissions-settings',
    testid: 'permissions-settings',
    expanded: expanded) do |c|
    - c.with_description do
      = _('Configure advanced permissions, Large File Storage, two-factor authentication, and customer relations settings.')
    - c.with_body do
      = render 'groups/settings/permissions'

  = render_if_exists 'groups/settings/ai/ai_settings'

- if can?(current_user, :manage_merge_request_settings, @group)
  = render_if_exists 'groups/settings/merge_requests/merge_requests', expanded: expanded, group: @group
  = render_if_exists 'groups/settings/merge_requests/merge_request_approval_settings', expanded: expanded, group: @group, user: current_user

- if can?(current_user, :admin_group, @group)
  = render ::Layouts::SettingsBlockComponent.new(s_('GroupSettings|Badges'),
    id: 'js-badge-settings',
    expanded: expanded) do |c|
    - c.with_description do
      = s_('GroupSettings|Customize this group\'s badges.')
      = link_to s_('GroupSettings|What are badges?'), help_page_path('user/project/badges.md')
    - c.with_body do
      = render 'shared/badges/badge_settings'

- if can?(current_user, :admin_compliance_framework, @group)
  = render_if_exists 'groups/compliance_frameworks', expanded: expanded

- if can?(current_user, :admin_group, @group)
  = render_if_exists 'groups/custom_project_templates_setting'
  = render_if_exists 'groups/templates_setting', expanded: expanded
  = render_if_exists 'shared/groups/max_pages_size_setting'

  = render ::Layouts::SettingsBlockComponent.new(_('Advanced'),
    id: 'js-advanced-settings',
    testid: 'advanced-settings-content',
    expanded: expanded) do |c|
    - c.with_description do
      = _('Perform advanced options such as changing path, transferring, exporting, or deleting the group.')
    - c.with_body do
      = render 'groups/settings/advanced'

- elsif can?(current_user, :remove_group, @group)
  = render 'shared/groups_projects/settings/restore', context: @group
  = render 'groups/settings/delete'
